#  面向对象编程
# 定义类 类:即是创建对象的蓝图
class Car:  # 定义类Car
    def __init__(self, brand, color):  # 定义函数
        self.brand = brand
        self.color = color

    def drive(self):
        print(f"{self.brand}  开车了！")


car = Car("Toyo11111ta", "Red")
car.drive()  # 输出：Toyota 开车了！


# 继承与封装

class ElectricCar(Car):
    def charge(self):
        print("充电中")


electric_car = ElectricCar("Tesla", "Black")
electric_car.drive()  # drive:推动;驱动
electric_car.charge()  # charge:指示;负载;指控

print('')  # 打断点
